<style>
	label{
		display: block;
		font-weight: bold;
	}
	input.text { 
		margin-bottom:12px; 
		width:85%; 
		padding: .4em; 
	}
</style>

<script>

$("#form_upsert_project").validationEngine();

$(document).ready(function(){
	$("#users_list_project").jqGrid({
		   	url:CI.baseUrl + 'index.php/users_controller/get_json_users_list',
			datatype: "json",
			mtype : "post",
		   	colNames:['Id','Username', 'Name', 'Lastname','Email'],
		   	colModel:[
		   		{name:'id',index:'id', width:100},
		   		{name:'username',index:'username', width:200},
		   		{name:'name',index:'name', width:180},
		   		{name:'last_name',index:'last_name', width:180},
		   		{name:'email',index:'email', width:190}
		   	],
		   	rowNum:10,
			height:240,
		   	rowList:[10,20,30],
		   	pager: '#users_list_project_pager',
		   	sortname: 'id',
		    sortorder: "asc",
		    viewrecords: true,
		    multiselect: true,
		    caption:"Add Users to the project"
		});
		jQuery("#users_list_project").jqGrid('navGrid','#users_list_project_pager',{edit:false,add:false,del:false, search:false, del:false});
	
});

function getSelectedUsers(){
	return jQuery("#users_list_project").jqGrid('getGridParam','selarrrow');
}
</script>

<div id="dialog-project" title="Create or edit Project">
	<form id="form_upsert_project" class="modal" METHOD="POST" action="<?= base_url() ?>index.php/project_controller/save/">
	<div class="container_12">	
	<div class="grid_6">
			<label for="project-name">Name</label>
			<input name="project-name" id="project-name" class= "text ui-widget-content ui-corner-all validate[required]"/>
	</div>
	<div class="grid_6">
			<label for="project-description">Description</label>
			<input id="project-description" name="project-description" class="text ui-widget-content ui-corner-all validate[required]"></textarea>
	</div>
	</div>
	<div>
	<br></br>
	<br></br>
	<br></br>
	</div>
	<div class="grid_12">
		<table id="users_list_project"></table> 
		<div id="users_list_project_pager"></div>
	</div>
	<input type="hidden" value="" name="project-id" id="project-id" />
	
	</form>
</div>
<?php $this->load->view('includes/footer'); ?>